import http from '@/utils/request'
import { base } from '@/config'
const baseUrl = base.user + '/etp'

// 企业主信息模块
const company = {
  // 获取企业主列表
  getList: params => {
    return http.get(`${baseUrl}/list`, params)
  },

  // 查询企业主关联用户列表
  getRelationUserInfo: params => {
    return http.get(`${baseUrl}/relationUserInfo`, params)
  },

  // 获取企业主信息
  getInfo: id => {
    return http.get(`${baseUrl}/getInfo/${id}`)
  },

  // 开通或者冻结企业主 -原更新企业主信息
  editInfo: data => {
    return http.postJson(`${baseUrl}/edit`, data)
  },

  // 添加企业主信息
  addInfo: data => {
    return http.postJson(`${baseUrl}/add`, data)
  },

  // 企业主审核通过
  approved: data => {
    return http.postJson(`${baseUrl}/approved`, data)
  },

  //  企业主状态变更
  editVerifyStatus: data => {
    return http.postJson(`${baseUrl}/etpStateChange`, data)
  },

  // 获取加盟数据统计
  getCount: () => {
    return http.get(`${baseUrl}/count`)
  },

  // 查询最新审核状态
  getVerifyStatus: id => {
    return http.get(`${baseUrl}/getVerifyStatus/${id}`)
  },

  // 导入客户信息
  importUser: params => {
    return http.postJson(`${baseUrl}/importUser`, params)
  }
}

export default company
